/*全选*/

function checkall (s,k){

    var a = document.getElementsByTagName('input');

    var n = a.length;

    for (var i=0; i<n; i++){

        if((a[i].type == "checkbox") && ( a[i].name.substr(0,k-1)==s )){

            a[i].checked = true;

        }

    }

}



/*反选*/

function uncheck (s,k){

    var a = document.getElementsByTagName('input');

    var n = a.length;

    for (var i=0; i<n; i++){

        if((a[i].type == "checkbox") &&  (a[i].name.substr(0,k-1)==s) ){

            if(a[i].checked == true){

                a[i].checked = false;

            }

            else{
                a[i].checked = true;
            }

        }

    }

}

function doall (s,k,n ){
    if( k ){
        checkall (s,n )
    }
    else{
        uncheck (s,n )
    }
}

function open_win(url,title){
    window.open(url,title,'width=350,height=220,toolbar=no, status=no, menubar=no, resizable=no, scrollbars=no');
}
